package sivin.uikit.adapter;

import android.view.View;

import androidx.recyclerview.widget.RecyclerView;
import androidx.viewbinding.ViewBinding;

public class ViewHolder<Binding extends ViewBinding> extends RecyclerView.ViewHolder {
    private Binding mBinding;

    public ViewHolder(View itemView, Binding binding) {
        super(itemView);
        mBinding = binding;
    }

    public static ViewHolder createViewHolder(ViewBinding viewBinding) {
        ViewHolder holder = new ViewHolder(viewBinding.getRoot(), viewBinding);
        return holder;
    }

    public Binding viewBinding() {
        return mBinding;
    }

}
